<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <title>动态画一个圆环</title>
    <style>
        *{
            margin: 0; padding: 0;
        }
        .wrap{
            position: relative;
            width: 200px;
            height: 200px;
            overflow: hidden;
        }
        .circle{
            height: 100%;
            box-sizing: border-box;
            border: 20px solid red;
            border-radius: 50%;
        }
        .circle:before{
            content: '';
            position: absolute;
            display: block;
            width: 100%;
            height: 50%;
            box-sizing: border-box;
            top: 50%;
            left: 0;
            border: 20px solid red;
            border-top: transparent;
            border-radius:  0 0 50% 50%/ 0 0 100% 100%;
            z-index: 2;
        }
        .top, .bottom{
            position: absolute;
            left: 0px;
            width: 100%;
            height: 50%;
            box-sizing: border-box;
            background: white;

        }
        .top{
            top: 0;
            z-index: 1;
            transform-origin: center bottom;
            animation: 1s back-half linear 1s;
            animation-fill-mode: forwards;
        }
        .bottom{
            z-index: 3;
            top: 50%;
            transform-origin: center top;
            animation: 1s front-half linear;
            animation-fill-mode: forwards;
        }
        @keyframes front-half{
            0%{
                transform: rotate( 0 );
            }
            99%{
                transform: rotate( 180deg );
                opacity: 1;
            }
            100%{
                transform: rotate( 180deg );
                opacity: 0;
            }
        }
        @keyframes back-half{
            0%{
                transform: rotate( 0 );
            }
            99%{
                transform: rotate( 180deg );
                opacity: 1;
            }
            100%{
                transform: rotate( 180deg );
                opacity: 0;
            }
        }
    </style>
</head>
<body>
<div class="wrap">
    <div class="circle"></div>
    <div class="top"></div>
    <div class="bottom"></div>
</div>
</body>
</html>